package Student;

public class Student extends Person{
    private String no;
    private double scoreEn;
    private double scoreMath;
    private double scoreCh;

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }
    public double aver(){
        double avg = (scoreEn+scoreMath+scoreCh)/3;
        return avg;
    }
    public double max(){
        double max;
        if(scoreEn>scoreMath&&scoreEn>scoreCh){
            max = scoreEn;
        }else if(scoreMath>scoreEn&&scoreMath>scoreCh){
            max = scoreMath;
        }else{
            max = scoreCh;
        }
        return max;
    }
    public double min(){
        double min;
        if(scoreEn<scoreMath&&scoreEn<scoreCh){
            min = scoreEn;
        }else if(scoreMath<scoreEn&&scoreMath<scoreCh){
            min = scoreMath;
        }else{
            min = scoreCh;
        }
        return min;
    }

    @Override
    public String toString() {
        return super.toString() +
                "Student{" +
                "no='" + no + '\'' +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                '}';
    }
}
